﻿using DMTroube_ZeKer.Control;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DMTroube_ZeKer.View.ToolView
{
    public partial class GiftContent : UserControl
    {
        MainWebView _webView;
        public GiftContent(MainWebView webView)
        {
            _webView = webView;
            InitializeComponent();
            string url = Path.GetFullPath("Resources/Html/pinglun.html");
            gifText.Source = new Uri("file:///" + url);
            _webView.LwInfo += _webView_LwInfo; ;
        }

        private void _webView_LwInfo(object? arg1, global::Model.Msg.ResultAnalysisInfo arg2)
        {
            string msg = string.Format("<div style=\"font-size: 12px;\">昵称:{0}</div><span style=\"color: cornflowerblue;\">{1}</span>+<span style=\"color: red;\">{2}</span>", arg2.UserName, arg2.Gift, arg2.GiftNum);
            gifText.ExecuteScriptAsync("addPinglun(\'" + msg + "\')");
        }
    }
}
